<template>
  <div class="list">
    <!-- 上 -->
    <div class="listTop clear">
      <img :src="itemData.img" alt="" />
      <div class="listText">
        <p>{{ itemData.p }}</p>
        <div class="message">
          <span class="first">{{ itemData.tuan }}</span>
          <span class="second">￥{{ itemData.price }}</span>
          <span class="last" @click="toProductsDatil">{{ itemData.status }}</span>
        </div>
      </div>
    </div>

    <!-- 下 -->
    <div class="listHeader clear">
        <div class="order" @click="toOrderCenter" >查看订单详情</div>
        <div class="tuan" @click="toGroupDetail">查看团详情</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GroupItem",
  props: ["itemData"],
  methods: {
    toProductsDatil (){
            this.$router.push({
                path:'/productDetails',
                params:{
                    id:1
                }
            })
        },

    toOrderCenter(){
      this.$router.push({
        path:'/orderCenter',
        params:{
          id:2
        }
      })
    },
    toGroupDetail(){
        this.$router.push({
          path:'/group-detail',
          params:{
            id:1
          }
        })
      }
        
  },
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.clear::before,
.clear::after {
  content: "";
  display: table;
}
.clear::after {
  clear: both;
}

.list {
  /* background-color: ghostwhite; */
  position: relative;
  border-bottom: 1px solid rgba(204, 204, 204, 0.308);
}

.listTop img {
  width: 90px;
  height: 90px;
  padding: 5px 5px 5px 0;
}

.listText {
  width: 248px;
  text-align: left;
  font-size: 14px;
}
.listHeader{
  margin-bottom: 14px;
}

.message{
    margin-top: 36px;
}

.first{
    margin-left: 4px;
    margin-right: 12px;
}

.second{
    font-weight: 600;
}

.last{
    margin-left: 80px;
    font-size: 12px;
    color: rgb(238, 10, 36);
}

.listTop img,
.listText {
  float: left;
}

.listTop {
  margin-top: 24px;
  /* border-bottom: 1px solid gainsboro; */
}

.order,
.tuan{
    width:110px ;
    height: 30px;
    line-height: 30px;
    text-align: center;
    /* border: 1px solid gainsboro; */
    border-radius: 6px;
    /* background-color:#fb9c2fd2; */
    color: ghostwhite;
    float: left;
    font-size: 12px;
}
.order{
    margin: 4px 6px 6px 120px;
     background-color:rgb(241, 212, 102);
    
}
.tuan{
    margin: 4px 6px;
    background-color:#fb9c2fd2;
}
</style>>

